package com.easylive.web.controller;

import com.easylive.entity.po.CategoryInfo;
import com.easylive.entity.query.CategoryInfoQuery;
import com.easylive.entity.request.category.AdminChangeSortReqVO;
import com.easylive.entity.request.category.AdminDelCategoryReqVO;
import com.easylive.entity.request.category.AdminSaveCategoryReqVO;
import com.easylive.entity.vo.ResponseVO;
import com.easylive.service.CategoryInfoService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: yudaxian
 * @DateTime: 2024/11/3 21:37
 **/
@RestController
@RequestMapping("/category")
public class CategoryController extends ABaseController {

    @Resource
    private CategoryInfoService categoryInfoService;

    /**
     * 查询分类信息
     * @return
     */
    @PostMapping("/loadAllCategory")
    public ResponseVO loadCategory() {
        // admin端修改会存储到redis中，客户端直接从redis中拿出来就行了
        List<CategoryInfo> list = categoryInfoService.getAllCategoryList();

        return getSuccessResponseVO(list);
    }

}
